package com.yhsimon.service;

import com.yhsimon.dao.BookMapper;
import com.yhsimon.pojo.Book;

import java.util.List;

public class BookServiceImpl implements BookService {
    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    public int addBook(Book book) {
        return bookMapper.addBook(book);
    }

    public int deleteById(int id) {
        return bookMapper.deleteById(id);
    }

    public int updateBook(Book book) {
        return bookMapper.updateBook(book);
    }

    public Book queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }

    public List<Book> queryAllBooks() {
        return bookMapper.queryAllBooks();
    }

    @Override
    public List<Book> queryBookByName(String bookName) {
        return bookMapper.queryBooksByName(bookName);
    }
}
